package com.qf.service.impl;

import com.qf.config.RebbitMqConfig;
import com.qf.pojo.resp.BaseResp;
import com.qf.service.UserService;
import com.qf.utils.EmailUtils;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * Created with IntelliJ IDEA. User: Administrator Date: 2021/11/10 0010 Time: 17:35 Description: No
 * Description
 */
@Service
public class UserServiceImpl implements UserService {

  @Autowired RedisTemplate redisTemplate;
  @Autowired RabbitTemplate rabbitTemplate;
  @Autowired EmailUtils emailUtils;

  private final Map codeMap = new HashMap();

  @Override
  public BaseResp getCode(String email) {
    Map map = new HashMap();
    map.put("email",email);

    rabbitTemplate.convertAndSend("qfshop-information-topic", "email", map);

    return new BaseResp(0, "验证码发送成功！", null, null);
  }
}
